// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import {
    HOST
} from '@/service/HOST'
import urls from '@/service/url'

import Vuex from 'vuex' // vue 模块管理
import VueRouter from 'vue-router' // vue路由
import router from './routers' // vue路由配置

import * as modules from '@/modules' // 所有模块
import App from './App'

Vue.use(VueRouter)
Vue.use(Vuex)



// 普通环境的初始化
const store = new Vuex.Store({ // vuex状态管理
    state: { //根状态机
        HOST: HOST, //资源服务器
        imgurl: HOST + urls.imgdir, //图片资源地址
        fonsize: 0 //全局文字大小标准
    },
    mutations: {

        setfonsize(state, value) {
            // 设置全局文字大小标准
            state.fonsize = value
        }

    },
    modules: modules //状态机模块
})


new Vue({
    router,
    store,
    render: h => h(App)
  }).$mount("#app");



/*------------*/